Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@csstools/postcss-hwb-function

Package Overview
Dependencies
Maintainers
3
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@csstools/postcss-hwb-function

Use hwb() color functions in CSS

  • 3.0.18
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.9M
increased by4.69%
Maintainers
3
Weekly downloads
 
Created

What is @csstools/postcss-hwb-function?

@csstools/postcss-hwb-function is a PostCSS plugin that allows you to use the HWB (Hue, Whiteness, Blackness) color function in your CSS. This function is part of the CSS Color Module Level 4 specification and provides an alternative way to define colors, which can be more intuitive for certain use cases.

What are @csstools/postcss-hwb-function's main functionalities?

Using HWB color function

This feature allows you to use the HWB color function in your CSS. The plugin will transform the HWB function into an equivalent RGB value.

/* Input CSS */
.example {
  color: hwb(90 0% 0%);
}

/* Output CSS */
.example {
  color: rgb(128, 255, 0);
}

Custom properties with HWB

You can define custom properties using the HWB function, and the plugin will convert these to RGB values, allowing you to use them throughout your CSS.

/* Input CSS */
:root {
  --main-color: hwb(200 30% 40%);
}
.example {
  color: var(--main-color);
}

/* Output CSS */
:root {
  --main-color: rgb(77, 102, 153);
}
.example {
  color: var(--main-color);
}

Other packages similar to @csstools/postcss-hwb-function

Keywords

FAQs

Package last updated on 07 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc